<!DOCTYPE html>
<html lang="ko">
<head>
	<meta charset="UTF-8">
	<title>Predefined Variables</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!-- Bootstrap -->
	<link href="../css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
	<div class="container">
		<div class="row">
        	<div class="span12">
	<?php # Script 2.2 - handle_form.php
	
	// Create a shorthand for the form data:
	$name = $_REQUEST['name'];
	$email = $_REQUEST['email'];
	$comments = $_REQUEST['comments'];

	// Create the $gender variable:
	if (isset($_REQUEST['gender'])) {
		$gender = $_REQUEST['gender'];
	} else {
		$gender = NULL;
	}

	/*
	$_REQUEST['age']
	$_REQUEST['gender']
	$_REQUEST['submit']
	*/

	// Print the submitted information:
	echo "<h4>Thank you, <b>$name</b>, for the following comments:<br/>
	<tt>$comments</tt></h4>
	<h4>We will reply to you at <i>$email</i>.</h4>\n";

	// Print a message based upon the gender value:
	if ($gender == 'M') {
		echo '<h4><b>Good day, Sir!</b></p>';
	} elseif ($gender == 'F') {
		echo '<h4><b>Good day, Madam!</b></h4>';
	} else { // No gender selected.
		echo '<h4><b>You forgot to enter your gender!</b></h4>';
	}

	?>
			</div>
		</div>
	</div>
	<script src="http://code.jquery.com/jquery.js"></script>
	<script src="../js/bootstrap.min.js"></script>
</body>
</html>